-
Notifications
You must be signed in to change notification settings - Fork 19
Restructure templates #307
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Restructure templates #307
Conversation
Signed-off-by: karthik2804 <[email protected]>
| export async function handler(req, res) { | ||
| console.log(req); | ||
| let router = Router(); | ||
| router.get("*", (_, req, res) => { handleDefaultRoute(req, res) }) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
potential nit that you can ignore: instead of separate functions, lambdas here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have a slight preference in this case to use functions as it keeps the router structure easily readable when more are added.
tschneidereit
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me! I added a few suggestions, but nothing major
Signed-off-by: karthik2804 <[email protected]>
|
@tschneidereit updated to be in line with the suggestions. |
tschneidereit
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
This PR restructures the templates so that the default directory structure follows more javascript-ish structure and tucks away knitwit as the user should not have to deal with it usually. It also updates the default HTTP templates to now have a router with a catch-all 404 set up.